Page 1 of 5 123 ... LastLast
Results 1 to 10 of 48

Thread: Purple Elephants Eventhandler

  1. #1

    Default Purple Elephants Eventhandler

    Ok just what is this for and do I need it? is adding stuff to this the same as adding at the end of Dmprecache exec global/some.scr? Just what exactly is the best way to exec a scr?
    I've seen this in mikes torso

    // Spawn Detection

    state STAND
    {
    states
    {
    PLAYER_SPAWNED : NEW_WEAPON
    }
    }

    state PLAYER_SPAWNED
    {
    movetype legs

    entrycommands
    {

    exec spawn_protect/spawn_protect.scr

    }

    states
    {
    STAND_REAL : default
    }
    }

    and I always added stuff in raised weapons part of mikes file

    so what is the best way?

  2. #2
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    My EventHandler was just a script to help me manage the Reborn Event System > http://www.x-null.net/forums/showthr...-Documentation <
    Because one thing i found i didnt like was that you could only assign one script for each event, so i made it so i could add multiple scripts to the one event easily, without having to open it up and edit it each time i added a new script.

    Where you execute a script depends on what the script does and how you want it to be executes.

    Scripts executed from DMprecache.scr are GENERALLY ( not limited to ofc ) to general scripts that are not map or player specific, but can ofc be made to find the map or a certain player. Example are the skins.scr or pingkick.scr

    Scripts executed from each map.scr are GENERALLY map specific scripts that work for that map and that map only, this include scripts that spawn objects with coords, but ideally most people just add spawned objects to the map.scr itself and not a separate script.

    Scripts executed from the STATE files are generally player specific, and address the player who executed it, the RAISE WEAPON state has been used ( and still is i suppose ) as a spawn event, because if the player raises their weapon they must be alive and spawned in game. But there are other states that can be used. Scripts executed from state files will make self the player.

    Each of those ways can ofc be adapted to use for any type of script. That was just a general idea.
    Me personally, i do not like to edit state files if i can avoid it, i find that people tend to not follow instructions when trying to add the mod to their server, and it can affect the reborns mike_torso file which ATM fixes landsharking and team_swap crashing, so that reason i try not to use them, Also i think with new update we can get the state the player is in through script, so that will be a godsend, i might not ever have to use state_files again :P

    So to summarize about my eventhandler, no you do not need it , if you plan to use the reborn events in your mods, then it is advised but again not necessary to use it.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  3. #3
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,566

    Default

    sounds nice purple , where is that script

  4. #4
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    I have a feeling that i have an updated version somewhere , but it will have to wait until i get home lol
    http://www.x-null.net/forums/showthr...eapons-limiter

    I know i have updated the weapon mod, but dnt no about the eventhandler lol
    Last edited by Purple Elephant1au; July 2nd, 2014 at 09:50 PM.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  5. #5

    Default

    Thanks a very good and most important understandable explaintion thank you

  6. #6
    Developer Todesengel's Avatar
    Join Date
    Dec 2013
    Location
    St. Louis, Missouri, USA
    Posts
    266

    Default

    Ok, I'm having trouble with purple's eventhandler. I'm using it to load up purples weapons mod and mines.

    I carefully added it to my existing server (taking care to address torso diffs and such). When I start the server it never finishes initializing, just hangs.
    So I created a test/sandbox server. Put down a clean mohaa/reborn install on it and tested it to work. I added the mefy teleport/extgametypes mod, then eventhandler, then weapons and mines. Again, taking care of any file name duplicates by manually diff'ing and merging. Still have the same problem as above.

    If I disable the event handler in global/dmprecache, and add the manual register lines for weapons and mines, it works. If I remove the weapons and mines mods totally and just enable the eventhandler (ie. eventhandler is enabled but no events are being loaded)... it dies. So it seems to be just the eventhandler by itself.

    Normally, my startup ends like...

    /---------------- MoH:AA 1.12 Reborn Patch InitFinished ----------------


    Loading Reborn Loader...
    ^~^~^ Box data is corrupted for 'models/human/allied_pilot/allied_pilot.skd'
    ^~^~^ Morph targets data is corrupted for 'models/human/allied_pilot/allied_pilot.skd'
    DUPLICATE ALIASES: plantbomb1 and plantbomb1
    ------ Server Initialization Complete ------ 1.32 seconds
    Hitch warning: 1367 msec frame time


    But anytime the event handler is enabled (even with no events registered), I get this...

    ---------------- MoH:AA 1.12 Reborn Patch InitFinished ----------------


    Loading Reborn Loader...
    ^~^~^ Box data is corrupted for 'models/human/allied_pilot/allied_pilot.skd'
    ^~^~^ Morph targets data is corrupted for 'models/human/allied_pilot/allied_pilot.skd'

    and that is where it hangs. So it never finishes initializing.

    I'm befuddled. Any ideas?

    J

  7. #7
    Developer Todesengel's Avatar
    Join Date
    Dec 2013
    Location
    St. Louis, Missouri, USA
    Posts
    266

    Default

    Ok, dug into the code a little, and got the bright idea to turn off autoload feature. I don't have any scripts in there at this point anyways... so just turned autoload off. And now... the server starts correctly.

    The mine and weapon mods both follow the 'advanced register' paradigm. The weapons mod seems to work, but the mines mod does not. When select nades.. I get 3 different ones... fragmentation, high explosive, another one I forget... but not mines/sticky's/c4.

    Some progress anyways. Any further tips appreciated

    J

  8. #8
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Post Logfile up, otherwise it is hard for us to see what the problem is.
    Please ensure you have developer mode on aswell either 2 or 3

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  9. #9
    Developer Todesengel's Avatar
    Join Date
    Dec 2013
    Location
    St. Louis, Missouri, USA
    Posts
    266

    Default

    Ok, I can do that late afternoon or tonight. Questions...

    Protocol - just copy/paste my qconsole.log in the message or is there some different forumEtiquette process to post it?

    What would be most helpful - the log with purple(eventhandler,weapons,mines) or remove weapons and mines so it's just eventhandler?

    I did try removing the calls in dmprecache to weapons and mines and setting auto_load to 1... the last thing in qconsole was "calling event handler..." and it just hung.

    I did also try removing the eventhandler completely, and in dmprecache having both the exec and the register lines. It then acts like weapons and mines mods aren't loaded.

    I bet I'm missing something really obvious :\

    J

  10. #10
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Hi,

    Logfile should either be attached or placed in [CODE.] Tags ( depending on size of logfile )

    Start with just the eventhandler running so we can see that problem first. It has been awhile since i made it so i might have to try to remember how i did it.

    The weapon and mines mod can work without the event handler, just need to register the events manually.

    I might have to update it soon to make it more efficient or at least cleaner code.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




Page 1 of 5 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •